package com.com.sky.downloader.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.administrator.smarthome_androids.OpenBean;
import com.example.administrator.smarthome_androids.DeviceInfo;

import com.com.sky.downloader.greendao.OpenBeanDao;
import com.com.sky.downloader.greendao.DeviceInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig openBeanDaoConfig;
    private final DaoConfig deviceInfoDaoConfig;

    private final OpenBeanDao openBeanDao;
    private final DeviceInfoDao deviceInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        openBeanDaoConfig = daoConfigMap.get(OpenBeanDao.class).clone();
        openBeanDaoConfig.initIdentityScope(type);

        deviceInfoDaoConfig = daoConfigMap.get(DeviceInfoDao.class).clone();
        deviceInfoDaoConfig.initIdentityScope(type);

        openBeanDao = new OpenBeanDao(openBeanDaoConfig, this);
        deviceInfoDao = new DeviceInfoDao(deviceInfoDaoConfig, this);

        registerDao(OpenBean.class, openBeanDao);
        registerDao(DeviceInfo.class, deviceInfoDao);
    }
    
    public void clear() {
        openBeanDaoConfig.getIdentityScope().clear();
        deviceInfoDaoConfig.getIdentityScope().clear();
    }

    public OpenBeanDao getOpenBeanDao() {
        return openBeanDao;
    }

    public DeviceInfoDao getDeviceInfoDao() {
        return deviceInfoDao;
    }

}
